import java.util.Date;

/**
 * @author 赵希奥
 * @date 2022/3/31 12:56
 * @gitHub https://github.com/CKXGZXA
 * @gitee https://gitee.com/ckxgzxa
 * @description: 日志装饰类, 充当具体装饰类
 */
public class LoggerDecorator extends UserDecorator {
    public LoggerDecorator(IUser user) {
        super(user);
    }

    @Override
    public void login() {
        displayTime();
        super.login();
    }

    @Override
    public void logout() {
        displayTime();
        super.logout();
    }

    public void displayTime() {
        System.out.println("当前时间: " + new Date());
    }
}
